clear
use "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 6 Regionalism\Data\CIs Brazil.dta"

twoway (bar pointestimate2 var9 if var5==1, base(0) barwidth(.75) color(black)) ///
(bar pointestimate2 var9 if var5==2, base(0.1009) barwidth(.75) color(gs6)) ///
(bar pointestimate2 var9 if var5==3, base(0.69068) barwidth(.75) color(gs10))   ///
 (bar pointestimate2 var9 if var5==4, base(0) barwidth(.75) color(black) color(black)) ///
 (bar pointestimate2 var9 if var5==5, base(0.3887) barwidth(.75) color(gs6)) ///
 (bar pointestimate2 var9 if var5==6, base(0.71149) barwidth(.75) color(gs10))  ///
  (bar pointestimate2 var9 if var5==7, base(0) barwidth(.75) color(black) color(black)) ///
  (bar pointestimate2 var9 if var5==8, base(0.532) barwidth(.75) color(gs6)) ///
 (bar pointestimate2 var9 if var5==9, base(0.7273) barwidth(.75) color(gs10))  ///
 (scatter label var15, mlab(candidate) msymbol(none) mlabcolor(white) mlabpos(0)) ///
 ,  xtitle("{bf:Ego's State of Residence}") xlab(3 "Roraima" 2 "Santa Catarina" 1 "Maranhão") ///
graphregion(color(white) margin(medlarge)) plotregion(lstyle(yxline) lcolor(black)) ///
ytitle("{bf:Model-Predicted Percentage (cumulative)}" "{bf:among Alters in Ego's Network}")  legend(off) ylab(0 "0%" .2 "20%" .4 "40%" .6 "60%" .8 "80%" 1 "100%")

twoway (bar pointestimate2 var9 if var5==1, base(0) barwidth(.75) color(black) lwidth(none)) ///
(bar pointestimate2 var9 if var5==2, base(0.59) barwidth(.75) color(gs6) lwidth(none)) ///
(bar pointestimate2 var9 if var5==3, base(0.69) barwidth(.75) color(gs10) lwidth(none))   ///
 (bar pointestimate2 var9 if var5==4, base(0) barwidth(.75) color(black) color(black) lwidth(none)) ///
 (bar pointestimate2 var9 if var5==5, base(0.32) barwidth(.75) color(gs6) lwidth(none)) ///
 (bar pointestimate2 var9 if var5==6, base(0.71149) barwidth(.75) color(gs10) lwidth(none))  ///
  (bar pointestimate2 var9 if var5==7, base(0) barwidth(.75) color(black) color(black) lwidth(none)) ///
  (bar pointestimate2 var9 if var5==8, base(0.193) barwidth(.75) color(gs6) lwidth(none)) ///
 (bar pointestimate2 var9 if var5==9, base(0.7273) barwidth(.75) color(gs10) lwidth(none))  ///
 (scatter label var15, mlab(candidate) msymbol(none) mlabcolor(white) mlabpos(0)) ///
 ,  xtitle("{bf:Ego's State of Residence}") xlab(3 "Roraima" 2 "Santa Catarina" 1 "Maranhão") ///
graphregion(color(white) margin(medlarge)) plotregion(lstyle(yxline) lcolor(black)) ///
ytitle("{bf:Model-Predicted Percentage (cumulative)}" "{bf:among Alters in Ego's Network}")  legend(off) ylab(0 "0%" .2 "20%" .4 "40%" .6 "60%" .8 "80%" 1 "100%")


graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 6 Regionalism\Figures\Brazil Disc Choice CIs.tif", as(tif) replace
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR6_6.tif", as(tif) replace width(1500)
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR6_6.pdf", as(pdf) replace 



*(rcap lowerci_cum upperci_cum var13, color(black)) 
